package cn.edu.sgu.www.mhxysy.service.children.impl;

import cn.edu.sgu.www.mhxysy.entity.children.ChildrenAttribute;
import cn.edu.sgu.www.mhxysy.mapper.children.ChildrenAttributeMapper;
import cn.edu.sgu.www.mhxysy.service.children.ChildrenAttributeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Service
public class ChildrenAttributeServiceImpl implements ChildrenAttributeService {

    private final ChildrenAttributeMapper childrenAttributeMapper;

    @Autowired
    public ChildrenAttributeServiceImpl(ChildrenAttributeMapper childrenAttributeMapper) {
        this.childrenAttributeMapper = childrenAttributeMapper;
    }

    @Override
    public ChildrenAttribute selectByChildrenId(String childrenId) {
        QueryWrapper<ChildrenAttribute> queryWrapper = new QueryWrapper<>();

        queryWrapper.eq("children_id", childrenId);

        return childrenAttributeMapper.selectOne(queryWrapper);
    }

}